package com.zhou.review3.serviceImpl;

import com.zhou.review3.entity.SysOrder;
import com.zhou.review3.mapper.SysOrderMapper;
import com.zhou.review3.service.SysOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysOrderServiceImpl implements SysOrderService {
    @Autowired
    private SysOrderMapper sysOrderMapper;

    public List<SysOrder> findAllSysOrder() {
        return sysOrderMapper.queryAll();
    }


    public int removeSysOrder(int id) {
        return  sysOrderMapper.deleteByPrimaryKey(id);
    }


    public void addSysOrder(SysOrder sysOrder) {
        sysOrderMapper.insert(sysOrder);
    }


    public SysOrder findSysOrder(int id) {
        return  sysOrderMapper.selectByPrimaryKey(id);
    }


    public void modifySysOrder(SysOrder newSysOrder) {
        sysOrderMapper.updateByPrimaryKey(newSysOrder);
    }

}
